import React from "react";
import ReactDOM from "react-dom";
import App from "./App";

import reportWebVitals from "./reportWebVitals";
import storage from "./utils/storageUtils";
import memory from "./utils/memoryUtils";
import { Provider } from "react-redux";
import store from "./redux/store";

// 读取localstorage中存储的用户信息，保存在内存中
// 这样项目一运行九八LocalStorage中的信息读到内存中去
const userinfo = storage.getUser();
memory.user = userinfo;
// ReactDOM.render(
//   <App></App>,
//   document.getElementById("root")
// );

ReactDOM.render(
  <Provider store={store}>
    <App></App>,
  </Provider>,
  document.getElementById("root")
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
